home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-21 / bus_mast.tec < prev    next >
Text File  |  1992-09-07  |  7KB  |  125 lines

  1. ID:BU Bus-Mastering Devices and QEMM-386
  2. Quarterdeck Technical Note #121
  3. by Stan Young
  4. last revision:  24 February 1992
  5.  
  6.           BUS-MASTERING DEVICES, QEMM-386 AND VIRTUAL DMA SERVICES
  7.  
  8. Q: What is a bus-mastering device and what problems might be seen when using 
  9. one?
  10.  
  11.      Bus-mastering devices are ones which do their own direct memory 
  12. addressing (DMA).  DMA is done without going through the machine's processor.  
  13. The most common bus-mastering devices we see currently are SCSI hard disk 
  14. controllers, but, technically, other types of devices could be bus-mastering 
  15. as well.  We have seen bus-mastering ESDI disk controllers and an increasing 
  16. number of bus-mastering network cards as well.  The problem seen with bus-
  17. mastering devices is that while they are high-performance devices and quite 
  18. often found on 386 and 486 machines, they are unfortunately, in their design, 
  19. incompatible with one of the operating modes of the 80386 and i486 processors -
  20. - the Virtual 86 mode.
  21.      Specifically, the problem is that the device puts data into absolute 
  22. memory addresses and assumes that the contents of those memory addresses will 
  23. always remain constant.  However, on a 386 machine with the processor in 
  24. Virtual 86 mode, this can often be an incorrect assumption.  In Virtual 86 
  25. mode, the same physical memory addresses can, at any given moment hold 
  26. different data, depending on which virtual machine is current.
  27.      If you are using a bus-mastering device on a 386 or 486 that is in 
  28. Virtual 86 mode and actual memory paging is occurring (the switching from one 
  29. virtual machine to another), your machine will probably hang when you use the 
  30. bus-mastering device.
  31.  
  32. A "real world" example:  
  33.  
  34.           Quarterdeck first became aware of the problem from customers who had 
  35.      bus-mastering SCSI hard disk controllers.  They reported that they could 
  36.      boot their machines, start our multitasking DESQview software and as long 
  37.      as they ran only one application, their system ran fine.  As soon as they 
  38.      opened a second application, the system would hang.  The problem was also 
  39.      seen by users who were not using DESQview, but who were using the LOADHI 
  40.      feature of QEMM-386.
  41.           In this case, the hang occurred because the disk controller would 
  42.      prepare to load some absolute memory addresses with data pertaining to an 
  43.      application that was running, but by the time the data was actually 
  44.      transferred to these addresses, QEMM-386 had switched the memory map.  
  45.      Those absolute memory addresses no longer belonged to the application 
  46.      which could process the data.  They belonged instead to some other 
  47.      application or process.  In theory, this could have caused data 
  48.      corruption, but in reality it never did. The memory corruption was 
  49.      typically so extensive that the systems simply hung as soon as a change 
  50.      in the memory map occurred. 
  51.  
  52. Q: How can the problem with running Bus-mastering devices in Virtual 86 mode 
  53. be corrected?
  54.  
  55. A: There are four possible solutions:
  56.  
  57.      1) QEMM 5.00 (and later versions) has a DB=xx (DISKBUF=xx) parameter 
  58.      which should prevent QEMM-SCSI problems at the expense of a little 
  59.      conventional memory.  xx is the number of K used for buffering.  Any 
  60.      value for xx is sufficient to correct the problem. DISKBUF=2 would be 
  61.      fine for most cases. Higher numbers, say up to 10 may improve 
  62.      performance.  Setting DISKBUF to more than 10 is probably a waste of 
  63.      memory.
  64.           This approach will not work in cases where the bus-mastering device 
  65.      is something other than a hard disk.  If your bus-mastering device is 
  66.      something other than a hard disk the solutions below, especially #4, are 
  67.      your only options.
  68.  
  69.      2) Similarly, the drivers of many bus-mastering hard disks have buffering 
  70.      options.  Check the documentation for your disk controller to see if the 
  71.      driver has a parameter to set up buffering for disk operations.  Some 
  72.      drivers will also document parameters that are specific to 386 
  73.      operations.  For example, the early Adaptec drivers SCSIHA.SYS and 
  74.      AHA1540.SYS included both 386 and disk buffering options invoked by the 
  75.      parameters "/v386" and "/b:64."  "/v386" stands for virtual 386; "/b:64" 
  76.      allocates a 64k buffer, for DMA.  
  77.  
  78.      3) Check the documentation for your bus-mastering device and see if it 
  79.      can be configured to use the BIOS or any one of the standard DMA 
  80.      channels.  QEMM can correct the problem if the BIOS or standard DMA 
  81.      channels are used.
  82.  
  83.      4) THE BEST SOLUTION:  Contact the maker of your bus-mastering device and 
  84.      see if they have a driver available which supports the VDS (Virtual DMA 
  85.      Services) specification.  VDS is now an industry-wide specification 
  86.      supported by IBM, Microsoft and Quarterdeck, as well as many other 
  87.      hardware and software suppliers.
  88.           A VDS driver allows a bus-mastering device to find the real physical 
  89.      address of its data when the processor is in Virtual 86 mode.
  90.  
  91.      QEMM 5.00 (and later versions) supports the VDS specification. A VDS 
  92. driver provides the best solution to this problem in terms of reliability, 
  93. speed and memory efficiency.  
  94.  
  95. Q:  I know I have a bus-mastering device on my computer, but I haven't seen 
  96.     any problem.  Why not?
  97.  
  98. A:  It's possible that your bus-mastering device uses a standard DMA channel 
  99.     for DMA operations.  QEMM-386 can correct the problem when standard DMA 
  100.     channels are used.  
  101.  
  102.     It is quite possible that your bus-mastering device was shipped with a 
  103. VDS driver.  Bus-mastering hard disk controllers are starting to ship with 
  104. drivers that make VDS calls, and these drivers do not require the DB parameter 
  105. or any other buffering.  We expect that most bus-mastering devices will 
  106. eventually include VDS drivers and therefore will not exhibit any problems 
  107. when run in Virtual 86 mode.
  108.  
  109. WINDOWS 3, QEMM-386, AND BUS-MASTERING DISK CONTROLLERS
  110.  
  111.      The problem mentioned here is also a problem for Microsoft's "Windows" 
  112. version 3.  Microsoft's solution is in SMARTDRV.SYS.  Smartdrive does the same 
  113. "double-buffering" for disk I/O that QEMM-386's DISKBUF parameter does.  Since 
  114. QEMM-386 is disabled when you enter Enhanced mode, this is a good thing.  If 
  115. you have a bus-mastering disk controller and wish to run Microsoft's "Windows" 
  116. program in Enhanced mode while loading any programs high, you must load 
  117. SMARTDRV.SYS and load it LOW.  In addition, the switch "/B-" disables this 
  118. service of SMARTDRV.SYS, so it cannot be used. 
  119.  
  120.   ************************************************************************
  121.   *This technical note may be copied and distributed freely as long as it*
  122.   *is distributed in its entirety and it is not distributed for profit.  *
  123.   *         Copyright (C) 1990-2 by Quarterdeck Office Systems           *
  124.   ************************ E N D   O F   F I L E *************************
  125.